import uiautomation
class Login():
        his = uiautomation.WindowControl(searchDepth=1, Name='科玛奇医院信息管理系统')  # 锁定窗口
        username = his.EditControl(AutomationId='PART_EditableTextBox', ClassName='TextBox') #账号
        passwd = his.EditControl(AutomationId='txtPwd', ClassName='PasswordBox') #输入密码
        login = his.ButtonControl(searchDepth=3, Name='登 录')#点击确定按
        queding = his.ButtonControl(searchDepth=3, Name='确定') #将更新文件改名之后需要点击

        #输入账号
        def input_username(self,name):
            self.username.SendKeys(name)
        #输入密码
        def input_password(self,password):
            self.passwd.SendKeys(password)
        #点击登录
        def click_login(self):
            self.login.DoubleClick()
        #点击弹窗确定
        def click_qd(self):
            self.queding.DoubleClick()
        def Login(self,name,password):
            self.username.SendKeys(name)
            self.passwd.SendKeys(password)
            self.login.DoubleClick()
            self.queding.DoubleClick()

